﻿package com.snakedickgames.common 
{
    import com.pblabs.engine.entity.EntityComponent;
    import flash.geom.Point;
    import flash.geom.Rectangle;
    
    
    public class RandomComponent extends EntityComponent
    {
        public var rect:Rectangle = new Rectangle();
        
        public function get randomValueX():Number
        {
            return Math.random() * rect.width + rect.left;
        }
        
        public function get randomValueY():Number
        {
            return Math.random() * rect.height + rect.top;
        }
        
        public function get randomPoint():Point
        {
            return new Point(randomValueX, randomValueY);
        }
    }

}